package com.mazaiting

import android.view.View
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.JavaScriptModule
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ReactShadowNode
import com.facebook.react.uimanager.ViewManager
import com.mazaiting.livedetection.LiveDetectionModule
import com.mazaiting.net.DownloadModule
import com.mazaiting.ocr.OcrModule
import java.util.*

/**
 * 自定义模块
 * Created by mazaiting on 2018/7/18.
 */
class CustomReactPackage : ReactPackage {
  override fun createViewManagers(p0: ReactApplicationContext?): MutableList<ViewManager<View, ReactShadowNode<*>>> {
    return Collections.emptyList()
  }
  
  override fun createNativeModules(reactContext: ReactApplicationContext?): MutableList<NativeModule> {
    return Arrays.asList(
            // 下载模块
            DownloadModule(reactContext!!),
            // 人脸检测模块
            LiveDetectionModule(reactContext),
            // 身份证识别
            OcrModule(reactContext)
    )
  }
}